<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        Commands\AddService::class,
        Commands\AddV3_1Service::class,
        Commands\CreateService::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
         //欠款提醒-每天9到15点调度各一次
        $schedule->command('command:debt')->twiceDaily(9, 15);
        // 购买VIP和储存空间到期提醒-每天0点执行一次
        $schedule->command('command:vipSpace')->daily();
        // 用户使用的上传文件占到空间大小统计-每小时执行一次任务
        //$schedule->command('command:fileSize')->everyMinute();
        //批次号推送预警消息 -每天0点执行一次
        $schedule->command('command:storageBatchMess')->daily();
        // 库存预警标记转换 (同步货架货位、序列号同步主账号、)- 每小时执行一次
        $schedule->command('command:storageAlert')->hourly();
        // 实时监控客户存储空间状态-每天9到15点执行一次
        $schedule->command('command:accountStorage')->twiceDaily(9, 15);
        // vip体验-每天0点执行一次
        $schedule->command('command:vipExperience')->daily();
        // 实时监控修改带逗号商品图片-每5分钟执行一次
        $schedule->command('command:updGoodsImg')->everyFiveMinutes();
        // 删除垃圾图片-每天一次执行一次
        //$schedule->command('command:delUploadImgScript')->dailyAt('23:55');
        // 删除垃圾图片-每天一次执行一次
        $schedule->command('command:delMainAccount')->dailyAt('23:50');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
